using System;
using System.Collections.Generic;
using UnityEngine;
using QFramework;

namespace ProjectMyFarmAndShe
{
	public partial class GodOfFigureInStone : ViewController
	{
		public List<Sprite> Sprites = new List<Sprite>();
		public int SpriteIndex = 0;
		
		void Start()
		{
			// Code Here
		}

		private void Update()
		{
			if (Time.frameCount % 30 == 0)
			{
				if (SpriteIndex > Sprites.Count - 1)
				{
					SpriteIndex = 0;
				}

				Icon.sprite = Sprites[SpriteIndex++];
			}
		}

		private void OnCollisionEnter2D(Collision2D other)
		{
			if (other.collider.CompareTag("Player"))
			{
				UIGameController.Default.OpenLevelUpPanel();
			}
		}

		private void OnCollisionExit2D(Collision2D other)
		{
			if (other.collider.CompareTag("Player"))
			{
				UIGameController.Default.CloseLevelUpPanel();
			}
		}
	}
}
